﻿using UnityEngine;
using System.Collections;
namespace IMIForUnity
{
    public interface IDevice
    {

        /// <summary>
        /// 打开相应的数据流
        /// </summary>
        /// <param name="frameType"></param>
        /// <param name="imageResolution"></param>
        /// <param name="pixelFormat"></param>
        /// <returns></returns>
        ErrorCode OpenStream(ImiWrapper.ImiFrameType frameType, ImiResolution.Type imageResolution, ImiWrapper.ImiPixelFormat pixelFormat);

        /// <summary>
        /// 关闭相应的数据流
        /// </summary>
        /// <param name="frameType"></param>
        /// <returns></returns>
        ErrorCode CloseStream(ImiWrapper.ImiFrameType frameType);

        /// <summary>
        /// 获得深度图信息
        /// </summary>
        /// <param name="depthData"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        ErrorCode GetDepthData(ushort[] depthData, uint timeOut);

        /// <summary>
        /// 获得深度图信息和骨骼信息
        /// </summary>
        /// <param name="depthData"></param>
        /// <param name="skeletonFrame"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        ErrorCode GetDepthDataAndSkeletonFrame(ushort[] depthData, ref ImiWrapper.ImiSkeletonFrame skeletonFrame, uint timeOut);

        /// <summary>
        /// 获得骨骼信息
        /// </summary>
        /// <param name="skeletonFrame"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        ErrorCode GetSkeletonFrame(ref ImiWrapper.ImiSkeletonFrame skeletonFrame, uint timeOut);

        /// <summary>
        /// 获得包含玩家id的深度图数据和骨骼信息
        /// </summary>
        /// <param name="depthPlayerData"></param>
        /// <param name="skeletonFrame"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        ErrorCode GetDepthPlayerDataAndSkeletonFrame(ushort[] depthPlayerData, ref ImiWrapper.ImiSkeletonFrame skeletonFrame, uint timeOut);

        /// <summary>
        /// 获得彩色信息
        /// </summary>
        /// <param name="colorData"></param>
        /// <param name="timeOut"></param>
        /// <returns>
        /// 0：成功.
        /// 1：失败.
        /// </returns>
        ErrorCode GetColorData(byte[] colorData, uint timeOut);

        /// <summary>
        /// 是否开启骨架平滑.
        /// </summary>
        /// <param name="isEnable">true:开启 false:关闭</param>
        void EnableSmoothSkeletonFrame(bool isEnable);

        /// <summary>
        /// 获得设备状态（连接、未连接）
        /// </summary>
        /// <returns></returns>
        ImiWrapper.ImiDeviceState GetDeviceState();

    }
}
